var n, actor_x, actor_y, actor, actor_index;
actor_x = argument[0];
actor_y = argument[1];
actor = argument[2];
if (object_exists(actor) == true)
{
    actor_index = instance_create(actor_x, actor_y, actor);
    actor_index.character_inventory_index[0] = ds_list_create();
    actor_index.character_inventory_index[1] = ds_list_create();
    actor_index.character_inventory_index[2] = ds_list_create();
    actor_index.character_inventory_maxitems = 16;
    actor_index.persistent = true;
    ds_list_replace(global.team, ds_list_find_index(global.team, actor), actor_index);
}
else
{
    actor_index = actor;
    actor_index.x = actor_x;
    actor_index.y = actor_y;
}
ds_map_add(global.cutscene_characters, "team_" + (actor_index).character_id, actor_index);
return (actor_index);
